package com.zxy.ziems.server.energy.enums;

/**
 * @Copyright (C),
 * @ClassName: AlarModeEnum
 * @Author: yanzhiwei
 * @Description:
 * @Date: 2024/4/15 16:24
 */
public enum EnergyDataTypeEnum {
    ENERGY(0, "用量"),
    CODE(1, "花费"),
    ;

    private final Integer code;
    private final String info;

    EnergyDataTypeEnum(Integer code, String info) {
        this.code = code;
        this.info = info;
    }

    public Integer getCode() {
        return code;
    }

    public String getInfo() {
        return info;
    }

    public static String getByCode(String code) {
        for (EnergyDataTypeEnum value : values()) {
            if (value.getCode().equals(code)) {
                return value.getInfo();
            }
        }
        return null;
    }


}
